﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<PersonalAlbumModel>" %>
<%@ Import Namespace="MyAlbum.Model" %>
<%@ Import Namespace="PersonalAlbum" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
  <div id="sectionContainer">
    <span class="error"><%=Html.Encode( Model.ErrorMessage)%></span>
        <%
            int itemPerRow = Math.Max(1, Model.Configuration.SectionsPerRow);
            string width = ((90-itemPerRow*4) / itemPerRow).ToString()+"%";
            foreach (var item in Model.Sections)
            {
                Model.CurrentSection = item;
                %>
             <div style=" width:<%=width%>" class="sectionBox">
            <%Html.RenderPartial("SectionItem", Model);%>
              </div>
              <%} %>
    <%if (Model.User.AllowActions())
      {%>
        <%=Html.ActionLink<CategoriesController>(a=>a.ShowCreate(),Model.Localize("Section.AddSection")) %>
              &nbsp;
            <%=Html.ActionLink(Model.Localize("Section.AllAlbums"), "Index", "Albums")%>
      <%}%>
     
      </div>


</asp:Content>
